import React from 'react' ;
import {Input,Button} from 'antd';
import { Row,Col } from 'antd' ;
import './Talentpolicy.scss' ;
import $ from "jquery";

import policy_banner from '../../static/Talentpolicy/policy_banner.jpg';
import p1 from '../../static/Talentpolicy/p1.jpg' ;
import p2 from '../../static/Talentpolicy/p2.jpg' ;
import p3 from '../../static/Talentpolicy/p3.jpg' ;

let policy_pic_arr = [p1,p2,p3] ;

class Talentpolicy extends React.Component{
    constructor(props){
        super(props) ;
        this.state = {
            home_news : policy_pic_arr[0] ,
        }
    }
    homeNewsChange(value,e){
        $(".home_news_menu span").removeClass('activeSpan') ;
        $(e.target).addClass('activeSpan') ;
        let pic = policy_pic_arr[value] ;
        this.setState({
            home_news : pic,
        })
    }

    render(){
        return(
            <div className='policy'>
                <div className={`policy_banner`}>
                    <img src={policy_banner} alt="等待加载"/>
                </div>
                <div className='policyTop'>
                    <div className='searchBox'>
                        <Input placeholder='请输入关键字'/>
                        <Button type='primary'>搜索</Button>
                    </div>
                </div>
                <div className='cont'>
                    <div className={`home_news_menu`}>
                        <span onClick={this.homeNewsChange.bind(this,0)} className={`activeSpan`}>法律</span>
                        <span onClick={this.homeNewsChange.bind(this,1)}>行政行规</span>
                        <span onClick={this.homeNewsChange.bind(this,2)}>人社部规章</span>
                    </div>
                    <div>
                        <img src={this.state.home_news} style={{ marginTop:'35px' }}/>
                    </div>
                </div>
            </div>
        )
    }
}

export default Talentpolicy ;